package ex4.logic;

import java.util.Comparator;

public class Score  implements Comparable<Score>{
	
	private int score;
	private String name;
	
	public Score(int score, String name) {
		this.score = score;
		this.name = name;
	}

	@Override
	public String toString() {
		return name + " : " + score   ;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}


	@Override
	public int compareTo(Score o2) {
        return (this.getScore()>o2.getScore() ? -1 :
        	(this.getScore()==o2.getScore() ? 0 : 1));
	}	
}
